#include "hash-table.h"
#include "spisok.h"
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>

struct Student
{
        int id;
        double avr;
        char * name;
};

struct Student * create_student(int id, double avr, char * name)
{
        struct Student * p = malloc(sizeof(struct Student));
        size_t len;

        p->id = id;
        p->avr = avr;

        len = strlen(name);
        p->name = malloc(len + 1);

        strcpy(p->name, name);

        return p;
}

void delete_student(Pointer _p)
{
        struct Student * p = _p;

        if (p->name)
        {
                free(p->name);
        }
        free(p);
}

int main()
{
	int g;
        HashTable ht;
                struct Student * p;
                struct Student * t;

                //st=student("Vasya,Petya","Groupa123");
                
                ht_init(&ht, 100, 0, delete_student);


                p = create_student(22, 4.6, "Petya");
                t= create_student(21, 4.6, "Ivan");
                ht_set(&ht, "k", p);
				g=ht_has(&ht,"k");
				ht_delete(&ht, "k");
               //ht_destroy(&ht);
				
                
        return 0;
}
